//
//  IMMessageBackgroundImageView.m
//
//  Created by molon on 8/23/14.
//  Copyright (c) 2014 molon. All rights reserved.
//

#import "IMMessageBackgroundImageView.h"

@implementation IMMessageBackgroundImageView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.userInteractionEnabled = YES;
    }
    return self;
}

- (BOOL)canBecomeFirstResponder
{
    return YES;
}

- (BOOL)canPerformAction:(SEL)action
              withSender:(__unused id)sender
{
    return (action == @selector(reSendMessage:)||action == @selector(copyContent:));
}

- (void)reSendMessage:(UIMenuItem*)menuItem
{
    if (self.reSendMessageBlock) {
        self.reSendMessageBlock(self);
    }
}

- (void)copyContent:(UIMenuItem*)menuItem
{
    if (self.copyContentBlock) {
        self.copyContentBlock(self);
    }
}

@end
